﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DienDanBinhLuan.aspx.cs" ValidateRequest="false" Inherits="WebHousingInfo.DienDanBinhLuan" %>
<%@ Register Src="~/Controls/Header.ascx" TagName="HD" TagPrefix="Header" %>
<%@ Register Src="~/Controls/MenuFooter.ascx" TagName="MN" TagPrefix="MenuFooter" %>
<%@ Register Src="~/Controls/Footer.ascx" TagName="FT" TagPrefix="Footer" %>
<%@ Register Src="~/Controls/NoiThat.ascx" TagName="NT" TagPrefix="NoiThat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Diễn đàn bình luận</title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="uni_wrapper">
        <Header:HD ID="Header" runat="server" />
        <div id="uni_main">
        <% string mode = Request.QueryString["id"];
           int idforumnews = Convert.ToInt32(mode);
           var objectForums = HousingInfo.Library.ForumNewsBO.GetForumNewsBO(idforumnews);   
        %>
        <% string modecategory = Request.QueryString["categoryid"];
           int idcategory = Convert.ToInt32(modecategory);
           var objectCategory = HousingInfo.Library.SubTopicForumBO.GetSubTopicForumBO(idcategory);
           var objectCate_Parrent = HousingInfo.Library.CategoryBO.GetCategoryBO(Convert.ToInt32(objectCategory.CategoryID));  
        %>
            <div id="content" class="clearfix">
            <div id="group_750_l">
			<div class="clearfix" id="ketquatimkiem">
				<div>
					<table class="binhluan">
						<tbody>
						    <tr>
							    <td>
								    <a href="BaiVietDienDan.aspx?idsub=<%=objectCategory.SubTopicForumID %>">
									    <img height="42" border="0" align="left" width="150" src="Admin/img/new_thread.gif">
								    </a>
							    </td>
							    <td>
							    <%
							        if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
                                { %> 
								    <a href="BinhLuanDeTai.aspx?idforum=<%=objectForums.ForumNewID %>&cate=<%=modecategory %>">
									    <img height="42" border="0" align="left" width="150" src="Admin/img/reply_new.gif">
								    </a>
							    </td>
							    <%}%>
						   </tr>
					   </tbody>
					</table>
				</div>
				
				<div class="box02_title">
					<table cellspacing="5" cellpadding="1" border="0">
						<tbody><tr valign="bottom">
							
							<td><a href="DienDanNhaDat.aspx">
								<img border="0" title="Go Back" src="Admin/img/navbits_start.gif" alt="Go Back"></a>
							</td>
							<td>&nbsp;</td>
							<td width="100%">
								<span class="navbar"><a href="DienDanNhaDat.aspx" accesskey="1">Diễn đàn nhà đất</a></span>
								<% if (objectCategory != null)
                               {
                                   if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
                                   { %>   
                                        <span class="navbar">&gt; 
                                            <a href="DienDanNhaDat.aspx"><%=objectCate_Parrent.CategoryName%></a>&gt; 
                                            <a href="DienDanTinTheoChuDe.aspx?idsub=<%=objectCategory.SubTopicForumID %>"><%=objectCategory.SubTopicForumName%></a>
                                        </span> 
								    <%}
                                   else
                                   { %>
                                        <span class="navbar">&gt; 
                                            <a href="DienDanNhaDat.aspx"><%=objectCate_Parrent.CategoryName%></a>&gt; 
                                            <a href="#"><%=objectCategory.SubTopicForumName%> (Chủ đề này đã bị khóa)</a>
								        </span> 
								    <%}
                                } %>
							</td>
						</tr>
						<tr>
							<td class="navbar" style="font-size: 10pt; padding-top: 1px;" colspan="3">
								<img border="0" title="Xem Thống Kê Mới" class="inlineimg" src="Admin/img/navbits_finallink_ltr.gif" alt="Xem Thống Kê Mới">
								<% if (objectForums != null)
                                { %>
								        <strong><%=objectForums.Title%></strong>
								    <%}
                                   else
                                   { %>
								        <strong>Tin Này Không Tồn Tại</strong>
								 <%} %>
							</td>
						</tr>
					</tbody></table>
		
				</div>								
			</div>
			<div class="clearfix" id="ketquatimkiem">			
				<table cellspacing="0" cellpadding="4" border="0" width="100%" id="post5215613">
					<tbody>
						<tr>							
							<td class="thead_binhluan">
								<a name="post5215613">
									<img border="0" title="Old" class="inlineimg" src="Admin/img/post_old.gif" alt="Old">
								</a>								
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=Convert.ToDateTime(objectForums.CreatedDate).ToString("dd/MM/yyyy HH:mm")%>
							</td>
							<td align="right" class="thead_binhluan">								
							</td>							
						</tr>
						<tr valign="top">
							<td width="180" class="tdprofile" rowspan="2">
								<div class="divprofile">			
									<div id="postmenu_5215613"> 										
										<a class="bigusername" href="ThanhVienDienDan.aspx?iduser=<%=objectForums.UserName %>" title="Ten User"><%=objectForums.UserName%></a>										
									</div>
									<div>
									    <a href="ThanhVienDienDan.aspx?iduser=<%=objectForums.UserName %>"><img border="0" title="user's Avatar" src="Admin/img/admin.gif" alt="user's Avatar"></a>
									</div>
									<div style="margin-top: 7px;">
										<a href="ThanhVienDienDan.aspx?iduser=<%=objectForums.UserName %>"><img border="0" title="user's Avatar" src="Admin/img/no_avarta.jpg" alt="user's Avatar"></a>
									</div>
											
								</div>
								<div class="user_info">					
									<table>
										<tbody><tr>
											<td>Tham gia</td>
											<% var objectUser = HousingInfo.Library.UserBO.GetUserBO(objectForums.UserName); %>
											<td>: <%=Convert.ToDateTime(objectUser.RegisterDate).ToShortDateString()%></td>
											<tr>
											    <td>Bài gởi</td>
											    <td>: 84</td>
										    </tr>
										</tr>
									</tbody></table>										
								</div>
							</td>							
							<td class="tdtieude">							
								<div class="post_body">
									<div class="smallfont">
										<img border="0" title="Mặc định" class="inlineimg" src="Admin/img/icon1.gif" alt="Mặc định">										
										<%=objectForums.Title%>
									</div>
										<hr size="1" class="hrtieude">
									<div id="post_message_5215613">									
										<font color="DarkSlateGray">
										<%=DeleteQuote(objectForums.ForumNewsContent)%>
										</font>
									</div>
								</div>								
								<div style="height: 20px; margin-bottom: 12px; margin-top: 20px; width: 100%;">	
								  <% if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
             { %>
                                     <div style="float:right;">
								        <a href="BinhLuanDeTai.aspx?idforum=<%=objectForums.ForumNewID %>&qouteforum=<%=objectForums.ForumNewID %>&cate=<%=modecategory %>">
									    <img border="0" align="left" src="Admin/img/quote.gif" />
								        </a>	
								        <a href="BaiVietDienDan.aspx?id=<%=objectForums.ForumNewID %>&goback=<%=modecategory %>-<%=mode %>">
									    <img border="0" align="left" src="Admin/img/edit.gif" />
								        </a>	
								    </div>
								    <%} %>								    												                                    	
								</div>                                          
								<div class="smallfont">
									<hr size="1" class="hrtieude">
									<em>										
										Nội dung được thay đổi lần cuối:
										<%=Convert.ToDateTime(objectForums.UpdatedDate).ToShortDateString()%> lúc 
										<span class="time"><%=Convert.ToDateTime(objectForums.UpdatedDate).ToString("HH:mm")%></span>.							
									</em>
								</div>
							</td>
						</tr>
						<tr>								
							<td align="right" valign="middle" class="tdbottom">							
							</td>
						</tr>
					</tbody>							
				</table>			
			</div>
			<% if (HousingInfo.Library.ForumCommentBOList.CheckForumComment_ByIDForum(objectForums.ForumNewID))
      {
          var objectforumcomment = HousingInfo.Library.ForumCommentBOList.GetForumCommentBOList_ByID(objectForums.ForumNewID);

          foreach (var objforumcomment in objectforumcomment)
          {                                            
        %>
			
			<div class="clearfix" id="ketquatimkiem">			
				<table cellspacing="0" cellpadding="4" border="0" width="100%" id="post5215613">
					<tbody>
						<tr>							
							<td class="thead_binhluan">
								<a name="post5215613">
									<img border="0" title="Old" class="inlineimg" src="Admin/img/post_old.gif" alt="Old">
								</a><%=Convert.ToDateTime(objforumcomment.CreatedDate).ToString("dd/MM/yyyy HH:mm")%>
							</td>
							<td align="right" class="thead_binhluan">								
							</td>							
						</tr>
						<tr valign="top">
							<td width="180" class="tdprofile" rowspan="2">
								<div class="divprofile">			
									<div id="postmenu_5215613"> 										
										<a class="bigusername" href="ThanhVienDienDan.aspx?iduser=<%=objforumcomment.UserName %>" title="Ten User"><%=objforumcomment.UserName%></a>										
									</div>
									<div>
									    <a href="ThanhVienDienDan.aspx?iduser=<%=objforumcomment.UserName %>"><img border="0" title="user's Avatar" src="Admin/img/admin.gif" alt="user's Avatar"></a>
									</div>
									<div style="margin-top: 7px;">
										<a href="ThanhVienDienDan.aspx?iduser=<%=objforumcomment.UserName %>"><img border="0" title="users's Avatar" src="Admin/img/no_avarta.jpg" alt="user's Avatar"></a>
									</div>
											
								</div>
								<div class="user_info">					
									<table>
										<tbody><tr>
											<td>Tham gia</td>
											<% var objectUserByComment = HousingInfo.Library.UserBO.GetUserBO(objforumcomment.UserName); %>
											<td>: <%=Convert.ToDateTime(objectUserByComment.RegisterDate).ToShortDateString()%></td>
										</tr>
										<tr>
											<td>Bài gởi</td>
											<td>: 84</td>
										</tr>
									</tbody></table>										
								</div>
							</td>							
							<td class="tdtieude">							
								<div class="post_body">
									<div class="smallfont">
										<img border="0" title="Mặc định" class="inlineimg" src="Admin/img/icon1.gif" alt="Mặc định">										
										<%=objforumcomment.ForumCommentTitle%>
									</div>
										<hr size="1" class="hrtieude">
									<div id="Div2">									
										<font color="DarkSlateGray">
										<%=DeleteQuote(objforumcomment.CommentContent)%>
										</font>
									</div>
								</div>
								<div style="height: 20px; margin-bottom: 12px; margin-top: 20px; width: 100%;">									    
								    <% if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
               { %>
                                    <div style="float:right;">																				
                                        <a href="BinhLuanDeTai.aspx?idforum=<%=objectForums.ForumNewID %>&qoutecomment=<%=objforumcomment.ForumCommentID %>&cate=<%=modecategory %>">
									    <img border="0" align="left" src="Admin/img/quote.gif" />
								        </a>	
								        <a href="BinhLuanDeTai.aspx?id=<%=objforumcomment.ForumCommentID %>&cate=<%=modecategory %>&try=<%=mode %>">
									    <img border="0" align="left" src="Admin/img/edit.gif" />
								        </a>
								    </div>
								    <%} %>	
								    
								</div>
								<div class="smallfont">
									<hr size="1" class="hrtieude">
									<em>										
										Nội dung được thay đổi lần cuối
										<%=Convert.ToDateTime(objforumcomment.UpdatedDate).ToShortDateString()%> 
                                    lúc 
										<span class="time"><%=Convert.ToDateTime(objforumcomment.UpdatedDate).ToString("HH:mm")%></span>.							
									</em>
								</div>								
							</td>
						</tr>
						<tr>								
							<td align="right" valign="middle" class="tdbottom">							
							</td>
						</tr>
					</tbody>							
				</table>			
			</div>
				<%}
      } %>
        <div id="link">
			<ul>
				<li class="disable_link"><a>« Trở về</a></li>
				<li class="select"><a>1</a></li>
				<li><a href="#"><strong>2</strong></a></li>
			</ul>
		</div>
          <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" class="tborder">
	        <tbody>
	            <tr class="logoforumhouse">
                    <td align="center" width="300" class="alt1">
                        <a target="_blank'" href="DienDanNhaDat.aspx">bo hinh lo go forum</a>
                    </td>
                    <td class="alt1">                    
	                    <table cellspacing="0" cellpadding="0" width="100%">
	                        <tbody>
	                        <% var object4rum = HousingInfo.Library.ForumNewsBOList.GetFiveForumNews_ByIDSubTopic(idcategory);
                            foreach (var ob4rum in object4rum)
                           { 
                                if(ob4rum.ForumNewID != idforumnews){
                                %>
	                            <tr>
	                                <td>
	                                    <a href="DienDanBinhLuan.aspx?categoryid=<%=ob4rum.SubTopicForumID%>&id=<%=ob4rum.ForumNewID %>"><%=ob4rum.Title %></a>
	                                </td>
	                            </tr>
	                        <%} }%>	                            
	                        </tbody>
	                    </table>	                    
	                </td>
	            </tr>	
	        </tbody>
	    </table> 
		<div class="box02_title">
			<table cellspacing="5" cellpadding="1" border="0">
				<tbody><tr valign="bottom">
					
					<td><a href="DienDanNhaDat.aspx">
						<img border="0" title="Go Back" src="Admin/img/navbits_start.gif" alt="Go Back"></a>
					</td>
					<td>&nbsp;</td>
					<td width="100%">
						<span class="navbar"><a href="DienDanNhaDat.aspx" accesskey="1">Diễn đàn nhà đất</a></span>
						<% if (objectCategory != null)
   {
       if (objectCategory.IsActive == true && objectCate_Parrent.IsActive == true)
       { %>   
						                        <span class="navbar">&gt; 
						                            <a href="DienDanNhaDat.aspx"><%=objectCate_Parrent.CategoryName%></a>&gt; 
						                            <a href="DienDanTinTheoChuDe.aspx?idsub=<%=objectCategory.SubTopicForumID %>"><%=objectCategory.SubTopicForumName%></a>
						                        </span> 
						                        <%}
       else
       { %>
						                        <span class="navbar">&gt; 
						                            <a href="DienDanNhaDat.aspx"><%=objectCate_Parrent.CategoryName%></a>&gt; 
						                            <a href="DienDanTinTheoChuDe.aspx?idsub=<%=objectCategory.SubTopicForumID %>"><%=objectCategory.SubTopicForumName%> 
                        (Chủ đề này đã bị khóa)</a>
						                        </span> 
						                        <%}
   } %>
					</td>
				</tr>
				<tr>
					<td class="navbar" style="font-size: 10pt; padding-top: 1px;" colspan="3">
						<img border="0" title="Xem Thống Kê Mới" class="inlineimg" src="Admin/img/navbits_finallink_ltr.gif" alt="Xem Thống Kê Mới">
						<% if (objectForums != null)
   { %>
						        <strong><%=objectForums.Title%></strong>
						    <%}
   else
   { %>
						        <strong>Tin Này Không Tồn Tại</strong>
						    <%} %>
					</td>
				</tr>
			</tbody></table>

		</div>	
		<div class="traloinhanh">
		    <span >Trả lời nhanh</span>
		</div>
		<div align="center">
		    <div class="thongbaotraloinhanh">Hãy viết bài có dấu để mọi người hiểu bạn nói gì. <br>
                Bài viết không dấu sẽ bị xóa mà không cần thông báo trước!
		    </div>
			<div align="left" style="width:90%;">
				<div class="smallfont">Bài viết:</div>
				<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
                <script type="text/javascript">

                    window.onload = function () {

                        CKEDITOR.replace('txttraloinhanh');

                    }
                </script>
				<div style="text-align:center;">				
                    <asp:TextBox ID="txttraloinhanh" runat="server"  TextMode="MultiLine" ></asp:TextBox>
				</div>
				<div style="text-align:right">				    
                    <asp:Button ID="btnguitraloinhanh" runat="server" Text="Gửi trả lời" 
                        onclick="btnguitraloinhanh_Click" />
                    <asp:Button ID="btntrolai" runat="server" Text="Quay Lại" 
                        onclick="btntrolai_Click" />
				</div>
			</div>
		</div>		
		</div>
		        <div id="group_5">
			        <div id="menu_nhadat">	  
				        <div class="title">NHÀ ĐẤT CHO THUÊ</div>
				        <div class="content">
					        <ul>
						        <li><a href="#">Nhà - Biệt thự - Phòng</a></li>
						        <li><a href="#">Cao ốc - Văn phòng</a></li>
						        <li><a href="#">Chung cư</a></li>
						        <li><a href="#">Kho - Xưởng - BĐS Khác</a></li>
					        </ul>
				        </div>				
				        <div class="footer"></div>
			        </div>
			        <NoiThat:NT ID="NoiThat" runat="server" />
		        </div>
            </div>
        </div>
         <MenuFooter:MN ID="MenuFooter" runat="server" />
         <Footer:FT ID="Footer" runat="server" />
    </form>
</body>
</html>
